package com.demo.order.restapi.service;

import com.demo.order.object.OrderQo;
import com.demo.order.restapi.mqchannel.InputSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.integration.annotation.ServiceActivator;

@EnableBinding(InputSource.class)
public class GoodsReceive {
    private static Logger logger = LoggerFactory.getLogger(GoodsReceive.class);


    @ServiceActivator(inputChannel = InputSource.REPLYCHANNEL, outputChannel = InputSource.GOODSREPLYCHANNEL)
    public String accept(OrderQo orderQo) {
//        logger.info("msg: ==========>" + orderQo);
        //TODO:处理相应逻辑
        logger.info("该订单商品信息已处理，订单编号=" + orderQo.getId());
        return "1";
    }
}
